<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>翻译插件设置</title>
    <style>
        body {
            width: 100%;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        .container {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        h1 {
            color: #333;
            margin-bottom: 30px;
            padding-bottom: 10px;
            border-bottom: 2px solid #f0f0f0;
        }

        .section {
            margin-bottom: 30px;
        }

        .section-title {
            font-size: 18px;
            font-weight: 500;
            margin-bottom: 15px;
            color: #444;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: #555;
        }

        select, input[type="text"] {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            margin-bottom: 8px;
        }

        .api-key-input {
            display: none;
        }

        .api-key-input.show {
            display: block;
        }

        button {
            background: #007bff;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }

        button:hover {
            background: #0056b3;
        }

        .status {
            margin-top: 20px;
            padding: 10px;
            border-radius: 4px;
            display: none;
        }

        .status.success {
            background: #d4edda;
            color: #155724;
            display: block;
        }

        .status.error {
            background: #f8d7da;
            color: #721c24;
            display: block;
        }

        .shortcut-key {
            display: inline-block;
            background: #f8f9fa;
            padding: 2px 6px;
            border-radius: 3px;
            border: 1px solid #ddd;
            font-family: monospace;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>翻译插件设置</h1>
        
        <div class="section">
            <div class="section-title">基本设置</div>
            <div class="form-group">
                <label for="default-target-language">默认目标语言</label>
                <select id="default-target-language">
                    <option value="zh">中文</option>
                    <option value="en">English</option>
                    <option value="ja">日本語</option>
                    <option value="ko">한국어</option>
                    <option value="fr">Français</option>
                    <option value="de">Deutsch</option>
                    <option value="es">Español</option>
                    <option value="it">Italiano</option>
                    <option value="ru">Русский</option>
                </select>
            </div>

            <div class="form-group">
                <label for="translation-service">默认翻译服务</label>
                <select id="translation-service">
                    <option value="libre">LibreTranslate (免费)</option>
                    <option value="google">Google Translate</option>
                    <option value="baidu">百度翻译</option>
                </select>
            </div>
        </div>

        <div class="section">
            <div class="section-title">API设置</div>
            <div class="form-group api-key-input" id="google-api-key-group">
                <label for="google-api-key">Google Translate API密钥</label>
                <input type="text" id="google-api-key" placeholder="输入API密钥">
            </div>
            
            <div class="form-group api-key-input" id="baidu-api-key-group">
                <label for="baidu-app-id">百度翻译APP ID</label>
                <input type="text" id="baidu-app-id" placeholder="输入APP ID">
                <label for="baidu-api-key">百度翻译密钥</label>
                <input type="text" id="baidu-api-key" placeholder="输入密钥">
            </div>
        </div>

        <div class="section">
            <div class="section-title">快捷键设置</div>
            <div class="form-group">
                <label>划词翻译：<span class="shortcut-key">Alt</span> + <span class="shortcut-key">T</span></label>
                <label>朗读文本：<span class="shortcut-key">Alt</span> + <span class="shortcut-key">S</span></label>
            </div>
        </div>

        <button id="save-settings">保存设置</button>
        <div id="status" class="status"></div>
    </div>
    <script src="options.js"></script>
</body>
</html>
